package xyz.scootaloo.draft.timer;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

/**
 * @author flutterdash@qq.com
 * @since 2021/5/2 18:24
 */
public class TimerTest {

    public static void main(String[] args) {
        Timer timer = new Timer("test");
        timer.schedule(new Task(), 3000, 1000);
    }

    static class Task extends TimerTask {

        @Override
        public void run() {
            System.out.println(Thread.currentThread() + ": " + new Date());
        }

    }

}
